home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / latex209 / contrib / jeep / jeep.sty (.txt) < prev    next >
LaTeX Document  |  1989-11-25  |  11KB  |  250 lines

  1. %NAME: jeep.sty
  2. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  3. % jeep.sty, February  3, 1989
  4. % G. W. Stewart
  5. % Department of Computer Science
  6. % University of Maryland
  7. % College Park, MD 20784
  8. % stewart@thales.umd.edu
  9. % This is a personal customization of the LaTeX style files
  10. % article (4/16/88) and report (5/26/88).  The changes are
  11. % described more fully in the document jeep.tex.  Briefly
  12. % the style
  13. %    1. Changes the default page sizes to reflect the fact
  14. %       that most output will be on 8.5 x 11 inch paper.
  15. %    2. Adds commands that allow the casual LaTeX to change
  16. %       the formats of chapter, section, and theorem heads.
  17. %    3. Adds commands to number equations and theorems within
  18. %       sections or subsections.
  19. %    4. Makes Lance Berc's three part headers and footers the
  20. %       default page style.  Adds a macro to underline the
  21. %       header.
  22. %    5. Changes the default numbering of enumerate to arabic.
  23. %       Adds a new enumeration environment in which the items
  24. %       are close together.
  25. %    6. Adds a command to produce a compact table of contents.
  26. %    7. Adds commands to produce symbolic footnote marks and
  27. %       equation labels.
  28. % Change the default page sizes.
  29. \setlength{\topmargin}{.25in}
  30. \setlength{\textheight}{7.5in}
  31. \setlength{\oddsidemargin}{.375in}
  32. \setlength{\evensidemargin}{.375in}
  33. \setlength{\textwidth}{5.75in}
  34. % Define the command \mychapter{<head1>}{<head2>}.  <head1>
  35. % is the text to put in the chapter head if there is a
  36. % chapter number; <head2>, if not.
  37. \def\@chapapp{Chapter}
  38. \def\chapapp{\@chapapp}
  39. \def\mychapter#1#2{
  40.    \def\@chaphead##1{#1}
  41.    \def\@schaphead##1{#2}
  42. \def\@makechapterhead#1{ \vspace*{\chaptopsep} { \parindent 0pt \raggedright
  43.  \ifnum \c@secnumdepth >\m@ne \@chaphead{#1} \else \@schaphead{#1} \fi
  44.  \par \nobreak \vskip \chapaftersep } }
  45. \def\@makeschapterhead#1{ \vspace*{\chaptopsep} { \parindent 0pt \raggedright
  46.  \@schaphead{#1}\par
  47.  \nobreak \vskip \chapaftersep } }
  48. % \chaptopsep is the space between the top of the text page and the
  49. % chapter head.  \chapaftersep is the space between the chapter
  50. % head and the text.
  51. \newlength{\chaptopsep}
  52. \setlength{\chaptopsep}{.5in}
  53. \newlength{\chapaftersep}
  54. \setlength{\chapaftersep}{.5in}
  55. % Default chapter headings.
  56. \mychapter{\LARGE \sc \thechapter. #1}{\LARGE \sc #1}
  57. % Define the command \mysection{<sec>}{<style>}{<prefix>}.
  58. % <sec> is the section level--section, subsection, etc.  <style>
  59. % is the style in which the section head is to be set; e.g.,
  60. % \large\bf.  <prefix> is what proceeds the head text, usually
  61. % \the<sec> followed by some putctuation.
  62. \def\@startsection#1#2#3#4#5#6{\if@noskipsec \leavevmode \fi
  63.    \par \@tempskipa #4\relax
  64.    \@afterindenttrue
  65.    \ifdim \@tempskipa <\z@ \@tempskipa -\@tempskipa \@afterindentfalse\fi
  66.    \if@nobreak \everypar{}\else
  67.      \addpenalty{\@secpenalty}\addvspace{\@tempskipa}\fi \@ifstar
  68.      {\@ssect{#3}{#4}{#5}{#1}}{\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}
  69. \def\@sect#1#2#3#4#5#6[#7]#8{\ifnum #2>\c@secnumdepth
  70.      \def\@svsec{}\else 
  71.      \refstepcounter{#1}
  72.      \edef\@svsec{\expandafter\relax\csname @pre#1\endcsname}\fi
  73.      \@tempskipa #5\relax
  74.       \ifdim \@tempskipa>\z@ 
  75.         \begingroup \expandafter\relax\csname @#1style\endcsname\relax
  76.           \@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty \@M #8\par}
  77.         \endgroup
  78.        \csname #1mark\endcsname{#7}\addcontentsline
  79.          {toc}{#1}{\ifnum #2>\c@secnumdepth \else
  80.                       \protect\numberline{\csname the#1\endcsname}\fi
  81.                     #7}\else
  82.         \def\@svsechd{
  83.             \expandafter\relax\csname @#1style\endcsname\relax
  84.             \hskip #3\@svsec #8\csname #1mark\endcsname
  85.                       {#7}\addcontentsline
  86.                            {toc}{#1}{\ifnum #2>\c@secnumdepth \else
  87.                              \protect\numberline{\csname the#1\endcsname}\fi
  88.                        #7}}\fi
  89.      \@xsect{#5}}
  90. \def\@ssect#1#2#3#4#5{\@tempskipa #3\relax
  91.    \ifdim \@tempskipa>\z@
  92.      \begingroup \expandafter\relax\csname @#4style\endcsname\relax
  93.      \@hangfrom{\hskip #1}{\interlinepenalty \@M #5\par}\endgroup
  94.    \else \def\@svsechd{#4\hskip #1\relax #5}\fi
  95.     \@xsect{#3}}
  96. \def\mysection#1#2#3{
  97.      \expandafter\def\csname @#1style\endcsname{#2}
  98.      \expandafter\def\csname @pre#1\endcsname{#3}
  99. % Default section heads.
  100. \mysection{section}{\large\bf}{\thesection.~}
  101. \mysection{subsection}{\normalsize\bf}{\thesubsection.~}
  102. \mysection{subsubsection}{\normalsize\bf}{\thesubsubsection.~}
  103. \mysection{paragraph}{\normalsize\bf}{\theparagraph.}
  104. \mysection{subparagraph}{\normalsize\bf}{\thesubparagraph.}
  105. % Redefine theorem environment macros to put \theoremcounterend
  106. % (default ".") after the "theorem" head.
  107. \def\@begintheorem#1#2{\sl \trivlist
  108.    \item[\hskip \labelsep{\bf #1\ #2\thmcounterend}]}
  109. \def\@opargbegintheorem#1#2#3{\sl \trivlist
  110.       \item[\hskip \labelsep{\bf #1\ #2\ (#3)\thmcounterend}]}
  111. \def\thmcounterend{.}
  112. % Define \numberbysection to number figures, table, equations, and
  113. % theorems within sections.  Similarly for \numberbysubsection.  Any
  114. % theorem-like environment numbered with theorem inherits this
  115. % numbering (however, be sure to define the.  theorem environment
  116. % before invoking \numberbysection or \numberbysubsection).
  117. \def\numberbysection{\renewcommand{\thesection}{\arabic{section}}
  118.                      \renewcommand{\theequation}{\thesection.\arabic{equation}}
  119.                      \@addtoreset{equation}{section}
  120.                      \renewcommand{\thetheorem}{\thesection.\arabic{theorem}}
  121.                      \@addtoreset{theorem}{section}
  122.                      \renewcommand{\thefigure}{\thesection.\arabic{figure}}
  123.                      \@addtoreset{figure}{section}
  124.                      \renewcommand{\thetable}{\thesection.\arabic{table}}
  125.                      \@addtoreset{table}{section}}
  126. \def\numberbysubsection{\renewcommand{\thesection}{\arabic{section}}
  127.               \renewcommand{\thesubsection}{\arabic{subsection}}
  128.               \renewcommand{\theequation}{\thesubsection.\arabic{equation}}
  129.               \@addtoreset{equation}{subsection}
  130.               \renewcommand{\thetheorem}{\thesubsection.\arabic{theorem}}
  131.               \@addtoreset{theorem}{subsection}
  132.               \renewcommand{\thefigure}{\thesubsection.\arabic{figure}}
  133.               \@addtoreset{figure}{subsection}
  134.               \renewcommand{\thetable}{\thesubsection.\arabic{table}}
  135.               \@addtoreset{table}{subsection}}
  136. \@definecounter{theorem}
  137. % Change the labels of enumerate and outline to arabic numbers.
  138. \def\labelenumi{\arabic{enumi}.} 
  139. \def\theenumi{\arabic{enumi}} 
  140. \def\labelenumii{\arabic{enumii}.}
  141. \def\theenumii{\arabic{enumii}}
  142. \def\p@enumii{\theenumi.}
  143. \def\labelenumiii{\arabic{enumiii}.}
  144. \def\theenumiii{\arabic{enumiii}}
  145. \def\p@enumiii{\theenumi.\theenumii.}
  146. \def\labelenumiv{\arabic{enumiv}.}
  147. \def\theenumiv{\arabic{enumiv}} 
  148. \def\p@enumiv{\p@enumiii.\theenumiii}
  149. % Outline is a new list style--the same as enumerate with
  150. % less space between the items.
  151. \def\outline{\ifnum \@enumdepth >3 \@toodeep\else
  152.       \advance\@enumdepth \@ne 
  153.       \edef\@enumctr{enum\romannumeral\the\@enumdepth}\list
  154.       {\csname label\@enumctr\endcsname}{\usecounter
  155.         {\@enumctr}\def\makelabel##1{\hss\llap{##1}}
  156.          \parsep \z@ \itemsep \z@ 
  157.          \ifnum \@enumdepth > 1 \topsep \z@ \fi}\fi}
  158. \let\endoutline =\endlist
  159. % Three part head and foot macros by
  160. % Lance Berc
  161. % Olivetti Research Center
  162. % 2882 Sand Hill Road
  163. % Menlo Park, California 94025
  164. % (415) 496-6200
  165. % lance@orc.olivetti.com
  166. \def\lhead#1{\gdef\@lhead{#1}} \def\lfoot#1{\gdef\@lfoot{#1}}
  167. \def\chead#1{\gdef\@chead{#1}} \def\cfoot#1{\gdef\@cfoot{#1}}
  168. \def\rhead#1{\gdef\@rhead{#1}} \def\rfoot#1{\gdef\@rfoot{#1}}
  169. \def\@lhead{} \def\@lfoot{}
  170. \def\@chead{} \def\@cfoot{}
  171. \def\@rhead{} \def\@rfoot{}
  172. \def\@threepart#1#2#3{\rlap{#1} \hfil {#2} \hfil \llap{#3}}
  173. \def\ps@threepartheadings
  174.     {
  175.     \def\@oddhead{\@threepart{\@lhead}{\@chead}{\@rhead}}
  176.     \def\@oddfoot{\@threepart{\@lfoot}{\@cfoot}{\@rfoot}}
  177.     \if@twoside
  178.     \def\@evenhead{\@threepart{\@rhead}{\@chead}{\@lhead}}
  179.     \def\@evenfoot{\@threepart{\@rfoot}{\@cfoot}{\@lfoot}}
  180.     \else
  181.     \def\@evenhead{\@threepart{\@lhead}{\@chead}{\@rhead}}
  182.     \def\@evenfoot{\@threepart{\@lfoot}{\@cfoot}{\@rfoot}}
  183.     \fi
  184.     }
  185. \ps@threepartheadings
  186. % Define \underhead to put a rule under the headers.  \nounderhead
  187. % suppresses \underhead on the current page.  The space between
  188. % the text and the rule is \underheadsep.
  189. \def\underhead{
  190.  \addtolength{\headheight}{\underheadsep}
  191.  \def\@outputpage{\begingroup\catcode`\ =10 \if@specialpage 
  192.      \global\@specialpagefalse\@nameuse{ps@\@specialstyle}\fi
  193.      \if@twoside 
  194.        \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot
  195.             \let\@themargin\oddsidemargin
  196.           \else \let\@thehead\@evenhead
  197.           \let\@thefoot\@evenfoot \let\@themargin\evensidemargin
  198.      \fi\fi
  199.      \shipout
  200.      \vbox{\normalsize \baselineskip\z@ \lineskip\z@
  201.            \vskip \topmargin \moveright\@themargin
  202.            \vbox{\setbox\@tempboxa
  203.                    \vbox to\headheight{\vfil \hbox to\textwidth{\@thehead}
  204.                          \vskip \underheadsep
  205.                           \if@nounderhead\global\@nounderheadfalse
  206.                                  \hbox to\textwidth{}
  207.                           \else  \hbox to\textwidth{\hrulefill}\fi}
  208.                  \dp\@tempboxa\z@
  209.                  \box\@tempboxa
  210.                  \vskip \headsep
  211.                  \box\@outputbox
  212.                  \baselineskip\footskip
  213.                  \hbox to\textwidth{\@thefoot}}}\global\@colht\textheight
  214.            \endgroup\stepcounter{page}\let\firstmark\botmark}
  215. \def\ps@empty{\@nounderheadtrue
  216.               \let\@mkboth\@gobbletwo\def\@oddhead{}\def\@oddfoot{}%
  217. \def\@evenhead{}\def\@evenfoot{}}
  218. \def\ps@plain{\@nounderheadtrue
  219.      \let\@mkboth\@gobbletwo
  220.      \def\@oddhead{}\def\@oddfoot{\rm\hfil\thepage
  221.      \hfil}\def\@evenhead{}\let\@evenfoot\@oddfoot}
  222. \newif\if@nounderhead \@nounderheadfalse
  223. \def\nounderhead{\@nounderheadtrue}
  224. \newlength{\underheadsep}
  225. \setlength{\underheadsep}{.5ex}
  226. % Define \tighttoc to alter table of contents entry so that
  227. % sections are treated like subsections, subsubsections, etc.
  228. \def\tighttoc{\def\l@section{\@dottedtocline{1}{0em}{1.4em}}}
  229. % Define \symbolnote{<num>}{<text>} to produce a note with footnote
  230. % mark <num> (less than 10).  The commands \symbolmark{<num>}
  231. % and \symboltext{<num>}{<text>} are analogues of
  232. % \footnotemark[<num>] and \footnotetext[<num>]{<text>}.
  233. \def\symbolnote#1#2{\let\@thefootn=\thefootnote%
  234. \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
  235. \footnotemark[#1]%
  236. \footnotetext[#1]{#2}%
  237. \let\thefootnote=\@thefootn
  238. \def\symbolmark#1{\let\@thefootn=\thefootnote%
  239. \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
  240. \footnotemark[#1]%
  241. \let\thefootnote=\@thefootn
  242. \def\symboltext#1#2{\let\@thefootn=\thefootnote%
  243. \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
  244. \footnotetext[#1]{#2}%
  245. \let\thefootnote=\@thefootn
  246. % Define symboleqn environment to make a displayed equation with
  247. % a symbolic equation label.
  248. \newenvironment{symboleqn}[1]{
  249.    \def\@savesymbol{#1}$$}{\eqno \@savesymbol $$\global\@ignoretrue}
  250.